<script type="text/javascript" src="<?php echo base_url(); ?>public/js/dtree.js"></script>
<style type="text/css">
@import "<?php echo base_url(); ?>public/css/dtree.css";
</style>
<div class="dtree">

	<p><a href="javascript: d.openAll();"><?php echo $M2_OPEN_ALL_TITLE; ?></a> | <a href="javascript: d.closeAll();"><?php echo $M2_CLOSE_ALL_TITLE; ?></a></p>

	<script type="text/javascript">
		<!--

		d = new dTree('d');
		d.add(0,-1,'');
		<?php foreach($M2_MENU_ITEMS as $item) {?>
			d.add(<?php echo $item->rid; ?>, <?php echo $item->parent?$item->parent:'0'; ?>,'<?php echo $item->item_name; ?>','<?php echo $item->item_controller?(site_url().'/'.$item->item_controller):'#'; ?>');
		<?php } ?>
		document.write(d);

		//-->
	</script>

</div>
